// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'
import ElementUI from 'element-ui';
import 'element-ui/lib/theme-chalk/index.css';
//引入富文本框架‘vue-quill-editor'的框架
//引入的框架未被使用就是灰色的
import VueQuillEditor  from 'vue-quill-editor';
import 'quill/dist/quill.core.css';
import 'quill/dist/quill.snow.css';
import 'quill/dist/quill.bubble.css';
//引入axios库 类似ajax
//  ./ 代表当前目录
import axios from './utils/axios';
//引入qs库 将数据转换成json
import qs from 'qs';
import store from './store/index'   //引入状态管理器
//富文本增强框架
import {quillEditor, Quill} from 'vue-quill-editor'
import {container, ImageExtend, QuillWatch} from 'quill-image-extend-module'
//动态meta seo
import MetaInfo from 'vue-meta-info';
//注册
Quill.register('modules/ImageExtend', ImageExtend)
var fs = require("fs");

// axios.defaults.withCredentials=true
//全局注册qs
Vue.prototype.qs = qs;
//全局注册axios
Vue.prototype.$axios = axios;
Vue.prototype.$fs = fs;
//使用UI框架
Vue.use(ElementUI);
//使用富文本框架
Vue.use(VueQuillEditor)
//header
Vue.use(MetaInfo)
//vue的全局设置，为FALSE时阻止Vue在启动时生产提示
Vue.config.productionTip = false
// Vue.http.options.credentials = true

/* eslint-disable no-new */
//初始化Vue对象
new Vue({
  //属性选择器，选择主页
  el: '#app',
  //加载路由
  router,
  store,
  //加载组件
  components: { App },
  //加载状态管理

  // template: '<App/>'
  //渲染函数
  render: h => h(App),
  mounted() {
    document.dispatchEvent(new Event('custom-render-trigger'))
  }
})
